#ifndef __COMMAND__H__
#define __COMMAND__H__

#include <stdio.h>
#include <string.h>
#include <core/g-bios.h>

#define __GBIOS_CMD__ __attribute__((section(".gbioscmd"))) 

// #define	CFG_PROMPT			"g-bios" GBIOS_VERSION "# " 	/* g-bios Command Prompt	*/
#undef  CMD_DEBUG
#define CMD_HST_DEP			16 // should be 2^n aligned,  history depth is 16
#define MAX_CMD_LEN  		256
#define MAX_CMD_ARG   		8

#define CMD_ADJUST_INDEX(index)	((index) & (CMD_HST_DEP - 1))

struct gbios_cmd {
	const char *cmd_name;
	const char *cmd_help; // short help
	int (*cmd_run)(int, char *[]);
};

#define DEFINE_GBIOS_CMD(name, help, run) \
	__GBIOS_CMD__ struct gbios_cmd __gbios_cmd_##name = {#name, help, run}

#endif
